package name.fowler.refactoring.simplestore;

public enum PriceCodes {
	
	Regular {
		@Override
		public double getAmount(int daysRented) {
			double amount = 0;
			amount += 2;
			if (daysRented > 2)
				amount += (daysRented - 2) * 1.5;

			return amount;
		}

		@Override
		public int getRentedPoints(int daysRented) {
			return 1;
		}
	},
	
	NewRelease {
		@Override
		public double getAmount(int daysRented) {
			double amount = 0;
			amount += daysRented * 3;

			return amount;
		}

		@Override
		public int getRentedPoints(int daysRented) {
			return daysRented > 1 ? 2 : 1;
		}
	},
	
	Childrens {
		@Override
		public double getAmount(int daysRented) {
			double amount = 0;
			amount += 1.5;
			if (daysRented > 3)
				amount = (daysRented - 3) * 1.5;

			return amount;
		}

		@Override
		public int getRentedPoints(int daysRented) {
			return 1;
		}
	};

	public abstract double getAmount(int daysRented);
	
	public abstract int getRentedPoints(int daysRented);
}
